#ifndef __PLAYER_H__
#define __PLAYER_H__

#include "msgqueue/msgobjs/tankmsgobj.h"
#include "render/objs/hpobj.h"

typedef void (Delegater::*OnPlayerDestroyFunc)();

class Player
{
public:
	Player(int id,
		string strName, 
		Point startPos, 
		float startAngle, 
		Point hpPos,
		float z,
		Color color);
	virtual ~Player();

	void DoMsg(TankMsg* pMsg);
	void Destroy();

	//get information
	int GetID();
	bool GetDestroyed();
	Point GetPos();
	bool GetGo();
	float GetRollAngle();
	float GetGunAngle();
	float GetSpeed();
	float GetRollSpeed();
	float GetGunSpeed();

private:
	void CopyData();
	void OnTankImpacted();

public:
	Event<OnPlayerDestroyFunc> OnDestroy;

protected:
	int m_id;
	bool m_bDestroyed;
	//objects
	TankMsgObj m_tankObj;
	HpObj m_hpObj;
};

#endif